#include "IMGroupManager.h"

void IMGroupManager::addGroup(const std::shared_ptr<IMGroup> &group)
{
    auto g = groups_.find(group->getId());
    if (g == groups_.end())
    {
        groups_[group->getId()] = group;
    }
}

void IMGroupManager::removeGroup(const std::shared_ptr<IMGroup> &group)
{
    auto g = groups_.find(group->getId());
    if (g != groups_.end())
    {
        groups_.erase(g);
        // 解散
        g->second->removeAll();
    }
}
